#include "contact.h"

void menu() {
	printf("***************************************\n");
	printf("****** 1 add            2 del    ******\n");
	printf("****** 3 modify         4 search ******\n");
	printf("****** 5 show           6 sort   ******\n");
	printf("****** 7 clean          0 exit   ******\n");
	printf("***************************************\n");

}

int main() {
	int input = 0;

	Contact my_contact;
	InitContact(&my_contact);
	do 
	{
		menu();
		printf("Please Enter your options: ");
		scanf("%d", &input);
		switch (input) {
		case 0: 
			printf("Program exited....");
			break;
		case 1:
			add(&my_contact);
			break;
		case 2:
			del(&my_contact);
			break;
		case 3:
			modify(&my_contact);
			break;
		case 4:
			search(&my_contact);
			break;
		case 5:
			show(&my_contact);
			break;
		case 6:
			sort(&my_contact);
			break;
		case 7:
			clean(&my_contact);
			break;
		default:
			printf("Please enter the correct option!\n");
		}
	} while (input);
	return 0;
}